﻿using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Wpf.Ui.Controls;
using ClientAppraise.Controls;

namespace ClientAppraise.Controls;
public partial class ListPageShowModel : ObservableObject
{
    readonly ZxPagination pagination;
    public ListPageShowModel(string Content, int PageIndex, int CurrentPage, int MaxPage, ZxPagination pagination)
    {
        this.Content = Content;
        this.PageIndex = PageIndex;
        IsEnabled = PageIndex > 0 && PageIndex <= MaxPage;

        if (PageIndex == CurrentPage)
        {
            Appearance = ControlAppearance.Success;
        }

        this.pagination = pagination;
    }

    public string Content
    {
        get; set;
    }

    public ControlAppearance Appearance
    {
        get; set;
    } = ControlAppearance.Transparent;

    public int PageIndex
    {
        get; set;
    }

    public bool IsEnabled
    {
        get; set;
    }

    [RelayCommand]
    private void OnClick()
    {
        pagination?.Button_Click(this);
    }
}

